To navigate files and directories in operating systems you can use GUI or command-line interface (through shell). These files and directories are organized in a hierarchical directory tree (main directory branches off and holds other directories and files).
C:, D: (A: and B: were used for floppy drives)\ (back slash)$RECYCLE.BIN)'my folder' or by my` folder (` is the escape character)Most common commands:
xxxxxxxxxx<command> <options> <arguments>Get-Help <command> : manual (-Full more info)<command> /? : manual for Command Prompt commandsGet-Alias <command> : get PowerShell command from its aliasecho <str> : print inputclear : clear screen (or ctrl + L)history : show command history (or ctrl + R for search, or #<command> and tab completion)exit : close terminalpwd : print working directoryls <path> : list files and directories (-Force for hidden files)tree <path> : list files and directories in a tree-like formatcd <path> : change directorymkdir <path> : create directoryrm <path> : remove file/directory (-Recurse for directory, -Force)cp <path1> <path2> : copy file/directory (-Recurse for directory, -Verbose)mv <path1> <path2> : move (or rename) file/directory
Wildcards (symbols used to represent one or more characters):
xxxxxxxxxx~ : user directory (i.e., `C:\Users\<user>`).. : one level up. : current directory? : any symbol* : any number of any symbols
PowerShell shortcuts:
| shortcut | description |
|---|---|
| Ctrl + C / V | copy/paste |
| Ctrl + L | clear terminal screen |
| Ctrl + C | kill current process |
| Tab | tab completion |
xxxxxxxxxxcat <file> : view contents of a file (-Head/-Tail <N> for first/last N lines)more <file> : open file with more text editor
Windows has a service called the Windows Search Service, which indexes files on a computer and compiles a list of their names and properties. This is a resource intensive process, so by default it's enabled only for files in user home directory in Windows 10, and disabled on Windows Servers. For the same reason you can't search data within files by default (to enable: Indexing Options → Advanced → File Types → Index Properties and File Contents [X]).
Search via PowerShell:
ls <path> -Recurse -Filter <str>sls <str> <files>$null)
xxxxxxxxxx<com> < <file> : stdin from file<com> > <file> : stdout to file (rewrite)<com> >> <file> : stdout to file (append)<com> 2> <file> : stderr to file (rewrite)<com> 2>> <file> : stderr to file (append)<com1> | <com2> : pipeline (stdin[i+1] = stdout[i])
Users and groups can be managed in Local Users and Groups tab of Computer Management tool or through PowerShell:
Computer Management tool:
PowerShell:
xxxxxxxxxxGet-LocalUser : show list of local usersGet-LocalGroup : show list of local groupsGet-LocalGroupMember <group> : show list of users in a groupnet user <user> * /add : add new user (/logonpasswordchg:yes force password change on next log in)net user <user> /delete : delete usernet user <user> * : change user password
Files and folder permissions are assigned using ACLs (access control lists):
| Permission | Description |
|---|---|
| Read |
|
| Read and execute |
|
| List folder contents |
|
| Write |
|
| Modify |
|
| Full Control |
|
DACLs can be viewed and modified via GUI or through PowerShell:
GUI:
Properties → Security: top box for list of users and groups, bottom box for list of permissionsPowerShell:
xxxxxxxxxxICACL (improved change ACL utility)icacls <path> : show permissions for a file/foldericacls <path> /grant <arg> : change file/folder permissionsicacls <path> /remove <arg> : remove file/folder permissions
Developers package software using software compiling tools. In Windows, software is usually packaged as .exe files (executable files). They contain instructions for a computer to perform, computer code and other files that program might use.
executables are created according to Microsoft's PE format (portable executable)
executables:
.msi file (Microsoft install package), which is used to guide the Windows Installer in the installation, maintenance, and removal of a program.msi file inside and no usage of the Windows Installer)Windows Store (application repository for Windows apps) uses .appx format for packages
programs can be installed using GUI or PowerShell
some executables can have option for special flags that allow silent installation, auto reboot after instalation, etc.
Packages usually rely on other pieces of code in order to work. In Windows these dependencies are dynamic-link libraries, or DLLs.
C:\Windows\WinSxS)In addition to SxS system Windows Package Manager can be used to install and maintain the libraries and other dependencies. A package manager makes sure that the process of software installation, removal, update, and dependency management is as easy and automatic as possible.
xxxxxxxxxxRegister-PackageSource -Name chocolatey -ProviderName Chocolatey -Location https://chocolatey.org/api/v2 : add Chocolatey as a package sourceGet-PackageSource : show a package source (to verify)Find-Package <name> -IncludeDependencies : locate package with its dependenciesInstall-Package -Name <name> : install packageGet-Package <name> : verify that package is installedUninstall-Package -Name <name> : uninstall package
Most Windows software is distributed in closed source packages (i.e., source code is hidden), but there are tools to check out installer actions (e.g., process monitoring from sysinterals toolkit or orca from Windows SDK).
Archive is one or more files compressed into a single file.
.tar, .zip, and .rarCompress-Archive command)Mobile applications usually can be downloaded only from a trusted source (like an app store). App store is a central managed marketplace for app developers to publish and sell mobile apps, i.e., the app store acts as package manager, and the app store service acts as a package repository.
Driver is software that helps hardware device interact with an OS.
In Windows devices and their drivers are managed through the Device Manager (access through devmgmt.msc or RMB on This PC → Manage → Device Manager).
Device Manager groups devices together by categories
when a new device is plugged into a computer Windows Plug n Play system automatically detects it:
Device Manager also allows to manually uninstall, disable and update drivers

Installing latest system updates is a good practice to keep OS secure and get the newest features. In Windows this process is managed by the Windows Update Client, which always runs in the background.
A file system is used to keep track of files and file storage on a disk. The major operating systems have their own unique file systems:
Windows uses NTFS by default, and Linux uses ext4 (most common)
for most file systems, cross OS support is minimal (e.g., Windows doesn't read ext4).
there is also FAT32 file system (used for flash drives):
A storage disk can be divided into partitions (pieces of the disk that can be managed independently). Partitions essentially act as separate sub-disks, but they all use the same physical disk.
Partition table is a component of a disk that tells the OS how the disk is partitioned (which are the boot partitions, space allocated for partitions, etc.)
There are two main partition table schemes which decide how to structure the information on partitions:
MBR (master boot record)
GPT (GUID partition table)
In Windows, disk partitioning and filesystem formatting can be done through the Disk Management utility (GUI) or with the Diskpart tool (CLI):
Disk Management
create a partition from an unallocated space on a disk
format a volume on this partition by choosing:
Diskpart
xxxxxxxxxxlist disk : list disksselect disk <N> : select disklist partition : list partitions for selected diskselect partition <N> : select partitionclean : remove all partitions and volume formatting from the selected diskcreate partition primary : create primary partition on a selected diskactive : make selected partition activeformat FS=<FS> label=<name> : format selected partitiondelete partition override : delete selected partition
After a filesystem has been formatted it needs to be mounted to a drive (to make it accessible). Windows does this automatically.
Virtual memory allows OS provide the available physical memory (RAM) to the running applications. It creates a mapping between virtual and physical addresses. Virtual memory allows programs:

When a particular page of data (data block) isn't being used by an application, it gets evicted (copied out of memory onto the hard drive). This way memory resources are used most efficiently, and if a program needs a page that's not accessed a lot, the OS can still get to it in swap.
In Windows virtual memory and pages are managed by the Memory Manager. Pages are stored in a hidden file pagefile.sys on the root partition of a volume. Default settings (size, number and location of page files) can be changed from a control panel (control panel → system and security settings → system → advanced system settings → advanced → settings (performance) → advanced).
NTFS file system uses MFT (master file table) to store and represent files and their metadata on a volume.
every file on a volume has at least one entry in the MFT (including the MFT itself)
usually, there's a one-to-one correspondence between files and MFT records, but if a file has a lot of attributes, there might be more than one record to represent it
each entry in the MFT has a unique identifier called the file record number
there are special types of a files in Windows that provide access to other files: shortcuts, symbolic links and hard links:
Shortcuts
Symbolic links
mklink <symlink> <file>Hard links
mklink /H <hardlink> <file>In Windows, monitoring of disk usage can be done with the Disk Management tool or with the disk usage utility (from sysinternals).
CleanManager.exe) to free some disk space by deleting temporary files, compressing rarely used ones, cleaning up logs and emptying the recycle binData corruption could happen for lots of reasons:
NTFS file system has features that minimize the danger of data corruption, as well as, features that recover data when it gets damaged:
journaling creates NTFS logs by monitoring changes in files metadata, so if a particular file gets corrupted, the file system will recover the previous state of a file
self-healing mechanism addresses minor problems and corruptions on the disk automatically in the background (to check the status use fsutil repair query <path> in PowerShell with admin privileges)
check disk utility is used for serious data corruption, i.e., bad disk sectors, disk failures, etc. (chkdsk in PowerShell with admin privileges):
xxxxxxxxxxchkdsk : check disks healthchkdsk /F <path> : check disk health and fix found problems
if Windows detects that some data on a disk has been corrupted it sets a special flag in its metadata, so chkdsk will see it on the next boot and will try to repair data automatically
Program is an application that a user can run.
Process is a program that's executing (i.e., user can have many processes of the same program running at the same time, e.g., browser tabs of a web browser).
smss.exe (session manager subsystem); it's followed by winlogon.exe (log-in process) and csrss.exe (client/server runtime subsystem), which handles the GUI and command-line interfacetaskkill /pid <PID>In Windows process monitoring can be handled with the Task Manager (taskmgr.exe), which can be accessed with:
tasklist utilityGet-Process commandIn Windows, in addition to Task Manager there is also a more powerful process management tool: Process Explorer. It doesn't come preinstalled with Windows, but can be downloaded from Microsoft website. It allows to:
Process management:
procexp.exe)Sometimes user might want to interrupt a process before it fully completes. Signals are used for that purpose, they can be generated through other processes and software, or with keyboard shortcuts. Most common signal in Windows is SIGINT (signal interrupt), which can be generated with a Ctrl + C shortcut. There are other signals, but there isn't an easy way to issue them in Windows.
In Windows, user can monitor system resources with the Resource Monitoring tool. It can be accessed through PowerShell with Get-Process command.
There are several protocols for remote connection in Windows:
SSH (secure shell)
SSH client needs to be installed on a user computer, and SSH server on a host machine (populars programs: OpenSSH and PuTTy)
SSH server doesn't need to be a physical machine, it can be just a software, that's running as a background process
openSSH: ssh <user>@<host>
-p <port> (22 by default for SSH)PuTTy: using GUI or with putty.exe -ssh <user>@<host> <port> in PowerShell
when user connects to a remote machine for the first time, they will be asked to verify the authenticity of a host, and after confirmation host will be added to the list of known hosts
SSH authentication keys can be used instead of passwords (more secure)
RDP (remote desktop protocol)
This PC → Properties → Remote Settings → enable remote connectionsmstsc.exe (Microsoft terminal services client) is used to create RDP connections (can be used through GUI or PowerShell)VPN (virtual private network)
SSH tunnels
pscp.exe <path1> <user>@<host>:<path2>Shared folders
net share in PowerShell to show a list of shared folders on a computerIn most systems, there is a service that runs in the background and constantly writes events to logs. In Windows, the logged events are stored in the Event Viewer (eventvwr.msc).
by default Event Viewer shows a summary of potentially important recent events
more information about selected event is displayed in the bottom pane
shows different event groupings (at the left-hand pane):
Installing an OS on a large number of machines using traditional methods (e.g., with a USB stick) can be very time consuming, so different methods are used instead:
Disk cloning
Network initiated deployment